package com.ysx.service;

import com.ysx.entity.Comment;
import com.ysx.entity.User;

import javax.mail.MessagingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Description: 评论业务层接口
 */
public interface CommentService {

    //根据博客id查询评论信息
    List<Comment> listCommentByBlogId(Long blogId);

    //添加保存评论
    int saveComment(Comment comment,Comment parentComment);

    //删除评论
    void deleteComment(Comment comment,Long id);
    // 根据父评论id查询留言信息
    Comment getEmailByParentId(Long parentId);
    /**
     * 新增邮件回复功能，有回复消息会有邮件提醒
     * @param user  传入用户参数，判断是否为管理员
     * @param comment  评论
     * @param request
     * @param response
     */
    void sendMail(User user, Comment comment, HttpServletRequest request, HttpServletResponse response) throws MessagingException;


}

